package jmine.tec.web.front.dispatcher.request;

import jmine.tec.annotations.Unmodifiable;
import jmine.tec.web.front.domain.BackOfficeRequest;
import bancosys.tec.persist.persister.listener.AbstractPersisterListener;

/**
 * Listener of back office request persistence events
 * 
 * @author lundberg
 */
@Unmodifiable
public class BackOfficeRequestPersisterListener extends AbstractPersisterListener<BackOfficeRequest> {

    private BackOfficeRequestLifecycle lifecycle;

    /**
     * Constructor
     * 
     * @param lifecycle lifecycle
     */
    public BackOfficeRequestPersisterListener(BackOfficeRequestLifecycle lifecycle) {
        super();
        this.lifecycle = lifecycle;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    protected void afterInsert(BackOfficeRequest bean) {
        super.beforeInsert(bean);
        this.lifecycle.process(bean);
    }

}